home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44a.zip / COM003.QM < prev    next >
Text File  |  1992-06-22  |  37KB  |  840 lines

  1. *                               com003.qm
  2. *                    Miscellaneous Commenting Macros
  3. *                        Written By Tom Hogshead
  4. *                       [ See COMTxx.QM For Use ]
  5. *                                 6/22/92
  6. *  Key                         Description
  7. * =====   ===============================================================
  8. *  @1     Fill 3 Character Wide Column Block With "Quote Comma Quote" ( )
  9. *         for Importing an Ascii Text File Into a Database
  10. *
  11. *  @4     Insert Prompted Text Into Each Line of a Column Block
  12. *
  13. *  @8     Insert Text at Beginning of Blocked Lines (John Goodman, Author)
  14. *
  15. *  @9     Comment or Un-Comment Line or Block
  16. *         with '*»' in Col 1,
  17. *»                    (like this)
  18. *
  19. *  @0     Comment or Un-comment Line
  20. *         with '*--' in Col 1,
  21. *--                   (like this)
  22. *
  23. *  @f1    Comment Non-macro Portion of File
  24. *  @f3    Comment Paragraph or Block
  25. *  @f4    Comment File
  26. *  @f5    Un-Comment File
  27. *  @f9    Builds a "Comment Box" for C Programmers
  28. *  @f10   Center C Program Comment
  29. *
  30. *  #F4__  Surround Column-Blocked Text With Box Of Desired Characters,
  31. *                                               ********
  32. *                                     Box Drawn *Around* Outside Border
  33. *                                               ********
  34. *                                     of Column Block, Juxtapose Text
  35. *                                               (John Goodman, Author)
  36. *
  37. *  @F4    Erase Outside Border Of Column-Blocked Text And Collapse Text
  38. *         Surronding Block To Original Position Before Box Was Made,
  39. *                                               (John Goodman, Author)
  40. *
  41. *  ^F7_   Prepend Prompted Text To, Or Delete Prompted Text From,
  42. *         The Beginning Of The Current Or Blocked Line(s),
  43. *                                               (John Goodman, Author)
  44. *
  45. *  #F7__  Prepend Prompted Text To, Or Delete Prompted Text From,
  46. *         The Beginning Of The Current Or Blocked Line(s),
  47. *         Initialize Find Prompt With Last Prompted Text
  48. *                                   (Tom Hogshead Modification Of ^F7)
  49. *
  50. *  @F7    Insert Text At Beginning Of All Blocked Lines,
  51. *                                               (John Goodman, Author)
  52. *
  53. *  @F8    Put Colon In Front Of "Rem" Lines For Faster Batch File Operation
  54. *
  55. *         {e:\up\COMT*}--Return To COMTxx.QM
  56. *
  57. *-- eoi
  58.  
  59.  
  60. *                            M A C R O S
  61. * ----------------------------------------------------------------------
  62. * @(1) Fill 3 Character Wide Column Block With "quote comma quote"
  63. *      for Importing an Ascii Text File Into a Database
  64. * ----------------------------------------------------------------------
  65. * This macro fills a 3 character wide column block with "quote comma
  66. * quote" for importing an Ascii text file into a database.  If QEdit
  67. * 2.15 is not used, remove the "setscreenoff".
  68. *                   Block              Becomes
  69. *                    vvv
  70. *                 689   543           689","543
  71. *                 842   874           842","874
  72.  
  73. @1  macrobegin
  74.         setscreenoff gotoblockend jtrue CLOSED  markcolumn gotoblockend
  75.     jfalse END
  76.     CLOSED:
  77.         fillblock '"' return gotoblockbeg gotoblockend markline
  78.         prevposition cursorright gotoblockend markcolumn
  79.         prevposition fillblock ',' return unmarkblock
  80.     END:
  81. *
  82. * 31 bytes Sat  10-19-1991  11:24:27 (TH @1)
  83.  
  84. * 
  85. * ----------------------------------------------------------------------
  86. * @(4)    Insert Prompted Text Into Each Line of a Column Block
  87. * ----------------------------------------------------------------------
  88. * Mark a column block where text is to be inserted.  At the pause,
  89. * input the text to be inserted and press <enter>.  Requires QEdit
  90. * v2.15. For example, mark a colum block as shown:
  91.  
  92. * This macro was written for John Durso on the ILink Semware echo,
  93. * Conference 21 April 30, 1992.
  94.  
  95. *           
  96. * xxxx,xxxx,xxxx,xxxx
  97. * xxxx,xxxx,xxxx,xxxx
  98. * xxxx,xxxx,xxxx,xxxx
  99. * xxxx,xxxx,xxxx,xxxx
  100. *           
  101.  
  102. * Inputing "MIDDLE," at the pause becomes:
  103.  
  104. * xxxx,xxxx,MIDDLE,xxxx,xxxx
  105. * xxxx,xxxx,MIDDLE,xxxx,xxxx
  106. * xxxx,xxxx,MIDDLE,xxxx,xxxx
  107. * xxxx,xxxx,MIDDLE,xxxx,xxxx
  108.  
  109. @4      macrobegin
  110.         setscreenoff                        * Turn off screen updates
  111.         horizontalwindow
  112.         editfile escape                     * For all Qconfig's             *|
  113.         closewindow                         * Closes block if open
  114.         gotoblockbeg jfalse END             * If false, no block, end macro
  115.         copyblock
  116.         fillblock "*" return                * Insert dummy char to replace
  117.         setscreenon                         * Turn screen on for pause
  118.         findreplace
  119.             "*" return
  120.             pause                           * Insert text to replace
  121.             setscreenoff                    * Turn off last 'flicker'
  122.             return "LN" return              * And finish insertion
  123.         unmarkblock
  124.     END:
  125. *
  126. * 45 bytes Thu  04-30-1992  21:56:47 (TH @1, to JD #21/5282)
  127. * 30 bytes Fri  05-01-1992  01:27:06 (TH @4, shortened, changed key)
  128. * 32 bytes Wed  05-13-1992  12:28:41 (TH @4, modified for all Qconfig's)
  129.  
  130. * 
  131. * -----------------------------------------------------------
  132. * @(8) Insert Text at Beginning of Blocked Lines or Current
  133. *      Line If No Blocks Marked, John Goodman, Author
  134. * -----------------------------------------------------------
  135. * This macro will insert a user-prompted string of text in front of
  136. * each line delineated by any type of block (character, line, or
  137. * column).  Only one block marker need be set.  If no block markers
  138. * are set, the current line will be acted upon.  The text to be
  139. * prepended should be entered by the user at the "Replace with:"
  140. * prompt.
  141. *
  142. * The cursor will be placed at the beginning of the line following
  143. * the line(s) acted upon so that the macro can be invoked
  144. * repeatedly to prepend text to a series of lines.  The macro
  145. * should work consistently regardless of toggle mode or QConfig
  146. * settings.
  147. *
  148. @8 MacroBegin
  149.         CursorRight     * Needed for single-line blocks
  150.         GotoBlockBeg    * Try going to block beg, retain pos.
  151.    JTrue BLK            * Determine if a completed block
  152.         DropAnchor      * If not, DropAnchor will finish it
  153.                         * or mark current line if none started
  154.         GotoBlockBeg    * Go to block beg to retain position
  155.    BLK: GotoBlockEnd    * Start at the end
  156.         FindReplace     * Dummy to Allow for Safe Macro Escape
  157.           #250 Return   *  Char Unlikely to be Found
  158.           DelLine       *  Erase old prompt
  159.           Pause Return  *  Allow User to Enter Repl Text
  160.           "LN" Return   *  Local, No Prompt Replace
  161.         MarkLine        * Mark first line
  162.         PrevPosition    * Return to beg of where block was
  163.         ShiftRight      * Shift all lines to right
  164.         BegLine         * Move cursor to column 1
  165.         GotoBlockEnd    * Move to 1st char of last line
  166.         MarkColumn      * Mark 1st character column
  167.         PrevPosition    * Return to first line
  168.         BegLine         * Needed for single-line blocks
  169.         MarkColumn      * Finish marking block
  170.         FillBlock       * Fill First Column with Char
  171.           #250 Return   *  Searched For Above
  172.         RepeatFind      * Repeat the FindReplace
  173.         GotoBlockEnd    * Go to the last line
  174.         UnmarkBlock     * Unmark the block
  175.         BegLine         * Return to beginning of line
  176.         CursorDown      * Go to next line
  177. *
  178. * 42 bytes Sat  07-27-1991  23:43:18 (JG)
  179.  
  180. * 
  181. *» -------------------------------------------------------------------
  182. *» @(9) Comment or Un-Comment Line or Block with '*»' in Col 1
  183. *» -------------------------------------------------------------------
  184. * This macro comments and un-comments the current line or a marked
  185. * block with '*»' in col 1 as follows:
  186.  
  187.   * Commenting      : Shifts text right two spaces
  188.   * Un-commenting   : Shifts text left two spaces to original position
  189.   * Blank Lines     : Not commented
  190.   * Fit Qconfig.dat : Yes
  191.   * Block Types     : Line, column or character
  192.  
  193. * A line, column or character block may be marked before invoking,
  194. * either open or closed, and all lines in block will be processed
  195. * without pausing.
  196.  
  197. *» This paragaph is commented with this macro. Replace #175 "»" with
  198. *» any character for alternate commenting second characters.
  199.  
  200. @9      MacroBegin
  201.     * ---------- Finish Marking Line or Block if Not Marked ----------*
  202.         CursorRight           * Needed for single-line blocks
  203.         GotoBlockBeg          * Try going to block beg, retain pos.
  204.    JTrue BLK                  * Determine if a completed block
  205.         DropAnchor            * If not, DropAnchor will finish it
  206.                               * or mark current line if none started
  207.         GotoBlockBeg          * Go to block beg to retain position
  208.    BLK: GotoBlockEnd          * Start at the end
  209.         MarkLine              * Mark line to close block
  210.         PrevPosition          * Return to block begin
  211.     * --------------- Test if Block Already Commented ---------------*
  212.         BegLine               * Go to bol in case line block
  213.         CursorRight CursorRight * Move to column 3
  214.         Find "*" #175 Return  * Test if line is already commented
  215.                               * ( replace #175 with any character
  216.                               *   for alternate second character)
  217.         "LB" Return           * (assumes all block commented or not)
  218.         Jfalse COMMENT        * If no "*»" in col 1, must comment
  219.     * ----------------------- Un-Comment Block -----------------------*
  220.     UNCOMMENT:                *ELSE
  221.         ShiftLeft ShiftLeft   * Col 1 has "*»", remove it
  222.         ShiftLeft             * Get rid of blank space
  223.         Jump END              * End macro
  224.     * ------------------------ Comment Block ------------------------*
  225.     COMMENT:
  226.         ShiftRight ShiftRight * Shift all lines to right twice
  227.         BegLine               * Move cursor to column 1
  228.         GotoBlockEnd          * Move to 1st char of last line
  229.         MarkColumn            * Mark 1st character column
  230.         PrevPosition          * Return to first line
  231.         BegLine               * Needed for single-line blocks
  232.         FillBlock             * Fill block with space #32
  233.         #32  Return           * (Change #32 to any ASCII character
  234.                               *  to comment blank lines)
  235.         FindReplace           * Replace
  236.         #32  Return           *  space
  237.         "*" #175 Return       *  with "*»"
  238.         "LN" Return           *  Local, No Prompt Replace
  239.     END:
  240.         UnmarkBlock           * Unmark the block
  241.         CursorDown            * Go to next line
  242. *
  243. * 64 bytes Tue  04-30-1991  16:33:59
  244.  
  245.  
  246. * 
  247. * ----------------------------------------------------------------------
  248. * @(0)  Comment or Un-Comment Line with '*--' in Col 1
  249. *--    (like this)
  250. * ----------------------------------------------------------------------
  251. * This macro comments and un-comments the current line only with '*--'
  252. * as follows:
  253.  
  254. *   Commenting      : Shifts text right 4 spaces
  255. *   Un-commenting   : Shifts text left  4 spaces to original position
  256. *   Blank Lines     : Commented
  257. *   Fit Qconfig.dat : Yes
  258. *   Block Types     : None, marks current line
  259.  
  260. @0  macrobegin
  261.         unmarkblock markline
  262.         begline
  263.         shiftright
  264.         Find "*-" return            * Test if line already commented
  265.         "L" return
  266.         jfalse ADD                  * If not, we need to add '*-- '
  267.         delch delch delch delch     *ELSE delete 4 spaces
  268.         shiftleft
  269.         jump END
  270.     ADD:
  271.         begline
  272.         insertline                  * InsertLine for Insert set ON/OFF
  273.         "*--"                       * Insert commenting characters,
  274.         joinline
  275.     END:
  276.         begline unmarkblock
  277. *
  278. * 39 bytes Sun  06-23-1991  00:43:28 (TH)
  279.  
  280. *-- test
  281.  
  282.  
  283.  
  284. * 
  285. * ------------------------------------------------
  286. * @(F1)  Comment Non-Macro Portion of File
  287. * ------------------------------------------------
  288. @F1 MacroBegin
  289.     Begfile InsertLine                  * Insert temp line in case macro
  290.  START:                                 * starts on line 1
  291.     MarkLine
  292.     Find " " "macrob" Return "I" Return * Find start of macro
  293.     Jtrue HAS_MACROB                    * If this para is a macro, go
  294.                                         * mark non-macro lines
  295.     EndPara                             *ELSE para is not a macro and
  296.                                         * go to end of para
  297.     Jump SHIFT                          * Go shift it
  298.  HAS_MACROB:
  299.     CursorUp MarkLine                   * Move up one line off macro
  300.                                         * and mark all non-macro lines
  301.  SHIFT:
  302.     ShiftRight ShiftRight               * Shift block right
  303.     BegLine                             * Move cursor to column 1
  304.     GotoBlockBeg                        * Move to 1st char of first line
  305.     MarkColumn                          * Mark 1st character column
  306.     PrevPosition                        * Return to last line
  307.     BegLine                             * Needed for single-line blocks
  308.     FillBlock '*' Return                * Fill 1st column with '*'
  309.     UnMarkBlock                         * Unmark non-macro block
  310.     EndPara NextPara                    * Move to para after macro
  311.     Jtrue START                         *ELSE at eof
  312.     UnMarkBlock                         * Unmark last non-macro block
  313.     BegFile DelLine                     * Go to tof, delete temp line
  314. *
  315. * 55 bytes Wed  03-27-1991  08:26:36 (TH @F1)
  316.  
  317. * 
  318. * ----------------------------------
  319. * @(F3)  Comment Paragraph or Block
  320. * ----------------------------------
  321. * @f3 places an asterisk and space in front of block that IS a
  322. * paragraph and also in front of any paragraph that is NOT marked as a
  323. * block from the cursor to the end of the paragraph.  Insert must be On.
  324.  
  325. @f3 Macrobegin
  326.         Gotoblockbeg
  327.     NEXT:
  328.         Endline Begline
  329.     Jfalse END
  330.         "* "
  331.         Cursordown
  332.     jump NEXT
  333.     END:
  334.  
  335. * 18 bytes Mon  08-20-1990  22:19:35
  336.  
  337. * 
  338. * --------------------
  339. * @(f4)  Comment File
  340. * --------------------
  341. @f4         macrobegin
  342.             unmarkblock
  343.             begfile markline
  344.             endfile markline
  345.             shiftright shiftright
  346.             begline
  347.             unmarkblock
  348.             markcolumn
  349.             begfile
  350.             fillblock '*' return
  351.             unmarkblock
  352. *
  353. * 20 bytes Tue  03-26-1991  14:57:37
  354.  
  355. * 
  356. * ----------------------------------------------------------------------
  357. * #(F4__) Surround Column-Blocked Text with Box of Desired Characters,
  358.                                    ********
  359. *         Box Drawn Around Outside *Border* of Column Block, Juxtapose Text
  360.                                    ********
  361. *                                               (John Goodman, author)
  362. * ----------------------------------------------------------------------
  363. * The following macro surrounds column-blocked text with a box of desired
  364. * characters. Place text to be surrounded in a column block and press
  365. * #F4. At the FillBlock prompt enter the desired border character. Box
  366. * size is unlimited, including empty boxes, and boxes of one character
  367. * up to surrounding full documents.  Macro is INSERT mode insensitive,
  368. * and there are no Find beeps because of failed searches. This macro
  369. * was written by John Goodman.
  370.  
  371. * Starting with a block like this:
  372.  
  373. *         12345678901234567890
  374. *         12345678901234567890
  375. *         12345678901234567890
  376. *         12345678901234567890
  377. *         12345678901234567890
  378.  
  379. * Macro #F4 does this . . .
  380.  
  381. *         12345678901234567890
  382.                **********
  383. *         12345*67890123*4567890
  384. *         12345*67890123*4567890
  385. *         12345*67890123*4567890
  386.                **********
  387. *         12345678901234567890
  388.  
  389. #F4  macrobegin
  390.     GotoBlockBeg            * Try going to block beg
  391.  JTrue START                * If we can, start processing
  392.     MarkColumn              * Try completing the block
  393.     GotoBlockBeg            * Try again to go to block beg
  394.  JFalse END                 * If we can't, no block there
  395.  START:
  396.     Copy PasteOver          * Copy the block and paste it back
  397.     InsertLine              * Insert blank line at top
  398.     MarkLine                * Make column block a line block
  399.     GotoBlockEnd            * (Line) block end is directly below!
  400.     MarkColumn              * Start a single column block
  401.     PrevPosition            * Go back to where block began
  402.     CopyBlock CopyBlock     * Copy column twice to shift text
  403.     CursorDown              * Move down to reset block position
  404.     PasteOver               * Paste orig block back in
  405.     CursorUp                * Move to upper right of outer block
  406.     MarkColumn              * Reset upper right corner
  407.     GotoBlockEnd            * Go to block end
  408.     CursorRight             * Move to where outer block will end
  409.     AddLine                 * Add extra line at bottom
  410.     MarkColumn              * Mark outer block end point
  411.     FillBlock Pause Return  * Prompt user for fill character
  412.     GotoBlockBeg            * Go to outer block begin
  413.     CursorDown CursorRight  * Move in for inner block
  414.     PasteOver               * Put original block back in
  415.     UnmarkBlock             * Clean up and go home!
  416.  END:
  417. *
  418. * 38 bytes Tue  05-07-1991  17:46:32
  419.  
  420. * 
  421. * ----------------------------------------------------------------------
  422. * @(F4)    Erase Outside Border of Column-Blocked Text and Collapse Text
  423. *          Surronding Block to Original Position Before Box Was Made
  424. *                                               (John Goodman, author)
  425. * ----------------------------------------------------------------------
  426. * Mark box border as a column block. @F4 erases outside border, returns
  427. * and collapses all text surrounding block to original position before
  428. * box was made.  Use with caution since the lines containing the top
  429. * and bottom edges of the block are deleted.
  430.  
  431. @F4 MacroBegin
  432.     GotoBlockBeg             * Try going to block begin
  433.  JTrue START                 * If we can, begin processing
  434.     MarkColumn               * If not, mark block end
  435.     GotoBlockBeg             * Try again to go to block begin
  436.  JFalse END                  * If we can't, no block
  437.  START:
  438.     ShiftRight               * Remove right edge of box
  439.     GotoBlockEnd             * Go to end of block
  440.     MarkLine                 * Start Line block
  441.     PrevPosition             * Return to block begin
  442.     GotoBlockEnd             * new block end is directly below
  443.     MarkColumn               * Start single column block
  444.     PrevPosition             * Return to old block begin
  445.     CursorRight              * Create 2-column block
  446.     MarkColumn               * Finish marking block
  447.     DelLine                  * Delete top edge of box
  448.     GotoBlockEnd             * Go to last line of block
  449.     DelLine                  * Delete bottom edge of box
  450.     DeleteBlock              * Delete 1st two columns of block
  451.  END:
  452. *
  453. * 26 bytes Wed  05-08-1991  15:36:31
  454.  
  455. * 
  456. * ----------------------
  457. * @(f5)  Un-Comment File
  458. * ----------------------
  459. @f5         macrobegin
  460.             unmarkblock
  461.             endfile markline
  462.             begfile markline
  463.             shiftleft shiftleft
  464.             unmarkblock
  465. *
  466. * 12 bytes Tue  03-26-1991  14:57:43
  467.  
  468. * 
  469. * ---------------------------------------------------------------
  470. * @(F7)  Insert Text at Beginning of All Blocked Lines (J GOODMAN)
  471. * ---------------------------------------------------------------
  472. *
  473. @F7 MacroBegin
  474.         CursorRight           * Needed for single-line blocks
  475.         GotoBlockBeg          * Try going to block beg, retain pos.
  476.    JTrue BLK                  * Determine if a completed block
  477.         DropAnchor            * If not, DropAnchor will finish it
  478.                               * or mark current line if none started
  479.         GotoBlockBeg          * Go to block beg to retain position
  480.    BLK: GotoBlockEnd          * Start at the end
  481.         FindReplace           * Dummy to Allow for Safe Macro Escape
  482.           #224 Return         *  Char Unlikely to be Found
  483.           Pause Return        *  Allow User to Enter Repl Text
  484.           "LN" Return         *  Local, No Prompt Replace
  485.         MarkLine              * Mark first line
  486.         PrevPosition          * Return to beg of where block was
  487.         ShiftRight            * Shift all lines to right
  488.         BegLine               * Move cursor to column 1
  489.         GotoBlockEnd          * Move to 1st char of last line
  490.         MarkColumn            * Mark 1st character column
  491.         PrevPosition          * Return to first line
  492.         BegLine               * Needed for single-line blocks
  493.         FillBlock             * Fill First Column with Char
  494.           #224 Return         *  Searched For Above
  495.         RepeatFind            * Repeat the FindReplace
  496.         UnmarkBlock           * Unmark the block
  497. * 37 bytes Wed  04-17-1991  21:02:33
  498.  
  499. * =========================================================================
  500. * Date: 05-01-91 (00:21)           Number: 275          SemWare Support BBS
  501. *   To: TOM HOGSHEAD               Refer#: NONE
  502. * From: JOHN GOODMAN                 Read: NO
  503. * Subj: MORE FOR REX                 Conf: 3 Macros
  504. * ------------------------------------------------------------------------
  505. * To Tom and Rex Edwards--
  506. *
  507. * Rex, I'm glad you're finding the comment macros useful!  I hope
  508. * Tom's followup comments will do the trick for you; I couldn't
  509. * have recommended anything better.
  510. *
  511. *» Not to let Tom have the last word, however...
  512. *» The following macro is a first (very rough) attempt to merge
  513. *» together the ideas in the comment/uncomment macro and the macro
  514. *» that prepends a user-prompted string of text to blocked lines or
  515. *» the current line (the idea for the second macro originated with
  516. *» Richard Blackburn and it has been refined since then--I'm not
  517. *» sure where Tom has put it in the AMAC files).
  518. * The macro below works the same as the comment/uncomment macro
  519. * except that it will prompt for a text string.  If the text string
  520. * is found at the beginning of the 1st line of the block, the macro
  521. * will delete that number of characters from the beginning of every
  522. * line in the block.  If the string is not found, it will add the
  523. * string to the beginning of every line in the block.
  524. *
  525. */ I have not had a chance to thoroughly test the macro or to try to
  526. */ streamline it, but I wanted to throw it out for comment (sic).
  527. */
  528. * >>Tom, I'm running up against a deadline here at my real (i.e.,
  529. * >>paying) job and may not be able to provide any further input on
  530. * >>the JMPPOS macros for a couple of days.  I scanned the last set
  531. * >>you sent and everything looks great!  Please don't let me hold
  532. * >>you up if you want to get it out quickly.
  533. * >>
  534. * >>...JDG
  535. *
  536. * (Comments above added, deleted, then added again by #F7)
  537.  
  538. * 
  539. * -------------------------------------------------------------------
  540. * ^(F7_) Prepend Prompted Text to, or Delete Prompted Text from,
  541. *        The Beginning of the Current or Blocked Line(s),
  542. *                                         (John Goodman, author)
  543. * -------------------------------------------------------------------
  544. * (Note: I have changed John's character #128 to @250 so as to not be as
  545. *  noticeable.)
  546.  
  547. ^F7   MacroBegin
  548.       CursorRight           * Needed for single-line blocks
  549.       GotoBlockBeg          * Try going to block beg, retain pos.
  550.  JTrue BLK                  * Determine if a completed block
  551.       DropAnchor            * If not, DropAnchor will finish it
  552.                             * or mark current line if none started
  553.       GotoBlockBeg          * Go to block beg to retain position
  554.  BLK: GotoBlockEnd          * Start at the end
  555.       MarkLine              * Mark line to close block
  556.       PrevPosition          * Return to block begin
  557.       ShiftRight            * Shift all lines to right
  558.       BegLine               * Move cursor to column 1
  559.       GotoBlockEnd          * Move to 1st char of last line
  560.       MarkColumn            * Mark 1st character column
  561.       PrevPosition          * Return to first line
  562.       BegLine               * Needed for single-line blocks
  563.       FillBlock             * FillBlock w/weird character
  564.        #250 Return
  565.       FindReplace           * Replace Weird Char on 1st Line
  566.        #250 Return          *  with user-prompted text
  567.        DelLine
  568.        Pause #250 Return
  569.        "1" Return           *  1st Occurrence (Line) Only
  570.       UnmarkBlock           * Unmark the block
  571.       CursorLeft
  572.       MarkCharacter         * Block the User's Text
  573.       BegLine
  574.       Cut                   * Cut Buffer Now Has Prompted Text
  575.       AddLine Paste         * Save text on the following line
  576.       Find #250 Paste Return  * Try to find weird char+text
  577.        "B" Return             *  on 1st line
  578.  JTrue DELTEXT
  579.                               * Text not found, add to every line
  580.       DelLine                 * Delete temp line
  581.       FindReplace #250 Return * Replace all occurrences of weird
  582.        Paste Return           *  char with user's text
  583.        "GN" Return
  584.  Jump END
  585.  DELTEXT:                     * Text not found, shift right
  586.       GotoBlockEnd            * Go to end of saved copy
  587.       DelLine                 * get rid of temp line
  588.       CursorUp                * go back to 1st line in same col
  589.       MarkColumn              * start col block, upper right
  590.       Find #250 Return        * find last weird char, this becomes
  591.        "GB" Return            *  lower left corner of col block
  592.       DeleteBlock             * delete the column block
  593.       CursorDown              * reposition to run again
  594.  END:
  595. *
  596. * 84 bytes Tue  04-30-1991  23:51:49
  597.  
  598. * 
  599. * -------------------------------------------------------------------
  600. * #(F7__) Prepend Prompted Text to, or Delete Prompted Text from,
  601. *         The Beginning of the Current or Blocked Line(s),
  602. *         Initialize Find prompt with last prompted text
  603. * -------------------------------------------------------------------
  604. * I changed John's ^F7 macro a bit so that the last prompt is
  605. * remembered by Find. This is helpful for repetitive entries.
  606.  
  607. #F7   MacroBegin
  608.       CursorRight           * Needed for single-line blocks
  609.       GotoBlockBeg          * Try going to block beg, retain pos.
  610.  JTrue BLK                  * Determine if a completed block
  611.       DropAnchor            * If not, DropAnchor will finish it
  612.                             * or mark current line if none started
  613.       GotoBlockBeg          * Go to block beg to retain position
  614.  BLK: GotoBlockEnd          * Start at the end
  615.       MarkLine              * Mark line to close block
  616.       PrevPosition          * Return to block begin
  617.       ShiftRight            * Shift all lines to right
  618.       BegLine               * Move cursor to column 1
  619.       GotoBlockEnd          * Move to 1st char of last line
  620.       MarkColumn            * Mark 1st character column
  621.       PrevPosition          * Return to first line
  622.       BegLine               * Needed for single-line blocks
  623.       FillBlock             * FillBlock w/weird character
  624.        #250 Return
  625.       FindReplace           * Replace Weird Char on 1st Line
  626.        #250 Return          *  with user-prompted text
  627. *       DelLine
  628.        CursorRight                                                    *|
  629.        Pause #250 Return
  630.        "1" Return           *  1st Occurrence (Line) Only
  631.       UnmarkBlock           * Unmark the block
  632.       CursorLeft
  633.       MarkCharacter         * Block the User's Text
  634.       BegLine
  635.       Cut                   * Cut Buffer Now Has Prompted Text
  636.       AddLine Paste         * Save text on the following line
  637.       Find #250 Paste Return  * Try to find weird char+text
  638.        "B" Return             *  on 1st line
  639.  JTrue DELTEXT
  640.                               * Text not found, add to every line
  641.       DelLine                 * Delete temp line
  642.       FindReplace #250 Return * Replace all occurrences of weird
  643.        Paste Return           *  char with user's text
  644.        "GN" Return
  645.  Jump END
  646.  DELTEXT:                     * Text not found, shift right
  647.       GotoBlockEnd            * Go to end of saved copy
  648.       DelLine                 * get rid of temp line
  649.       CursorUp                * go back to 1st line in same col
  650.       MarkColumn              * start col block, upper right
  651.       Find #250 Return        * find last weird char, this becomes
  652.        "GB" Return            *  lower left corner of col block
  653.       DeleteBlock             * delete the column block
  654.       CursorDown              * reposition to run again
  655.  END:                         *
  656.       FindReplace Return      *                                       *|
  657.       Paste                   * Re-initialize Find prompt with        *|
  658.                               *  prompted text                        *|
  659.       Return Escape           * Cancel FindReplace                    *|
  660. *
  661. * 84 bytes Tue  04-30-1991  23:51:49 (JG ^F7)
  662. * 89 bytes Thu  05-02-1991  10:24:01 (TH |)
  663.  
  664. * 
  665. * ---------------------------------------------------------------------
  666. * @(F8)  Put colon in front of *rem* line for faster batch file operation
  667. * ---------------------------------------------------------------------
  668. * "Rem" lines in batch files make batch files run slower. Lines which
  669. * are labels (colon as first character) do not. This macro simply puts
  670. * a colon in column 1 for each line containing "rem ". Each rem line
  671. * for my system takes about 0.2 seconds with disk cache, and 0.5 seconds
  672. * per line with no disk cache. I found one batch file with 30 plus
  673. * rem lines - 15 seconds less running time by labelling rem lines!
  674. *
  675. * NOTE:  At least a space and one character of text must follow "rem"
  676. * to be labelled, eg the following would not be labeled:
  677. *       rem
  678. *       echo remember
  679. * The following would be labeled:
  680. *       rem  this is a test
  681. *       echo harem holiday!
  682. *              
  683. *
  684. @F8     MacroBegin
  685.         Begfile InsertLine
  686.         Editfile "c:\!" Return KillFile Quit EditFile Return
  687.         SaveFile Quit
  688.  START:
  689.         Unmarkblock
  690.         Find "rem " Return "I " Return
  691.         Jfalse END
  692.         BegLine Dropanchor Wordright Dropanchor Shiftright Begline
  693.         Find ":" Return "L" Return
  694.         Jtrue NEXT
  695.         Cursorright ":"
  696.  NEXT:
  697.         Shiftleft Markline WriteBlock Return "A"
  698.         Endline Cursordown
  699.         Jfalse END
  700.         Cursorup
  701.         Jump START
  702.  END:
  703.         Begfile DelLine Editfile Return DelLine KillFile UnMarkBlock
  704. *
  705. * 82 bytes Mon  03-25-1991  16:49:26
  706.  
  707. * 
  708. * ----------------------------------------------------------------------
  709. * @(f9) Builds a "Comment Box" for C Programmers, Tim Farley, author
  710. * ----------------------------------------------------------------------
  711. *
  712. * =========================================================================
  713. * Date: 04-18-91 (10:02)           Number: 230          SemWare Support BBS
  714. *   To: TOM HOGSHEAD               Refer#: 229
  715. * From: TIM FARLEY                   Read: NO
  716. * Subj: COMMENTS ON @7               Conf: 3 Macros
  717. * ------------------------------------------------------------------------
  718. * TH>  Very clever using FillBlock to fill a column 1 column block with dummy
  719. * TH>  character #224 and then replacing #224 with user input text. In all
  720. * TH>  cases I could think of it works perfectly - can't stump it!
  721. *
  722. * Another neat trick I like to use FillBlock for, is to make
  723. * "boxes" of a single character.
  724. *
  725. * For instance, if you want to make a large box of asterisks, just
  726. * mark a column block of the appropriate size and shape, do:
  727. *
  728. *      FillBlock "*" Return
  729. *
  730. * Then do some appropriate cursor commands to move "in" one column
  731. * in each direction from the edges of the block, mark again, and
  732. * do:
  733. *
  734. *      FillBlock " " Return
  735. *
  736. * Voila!  A box of asterisks with space in the middle.
  737. *
  738. * With a few frills for "C", the complete macro looks like this:
  739. *
  740. *
  741. * Builds a "comment box" for C programmers.
  742. *
  743. * The box starts on the left at the current indent level, and
  744. * extends over to column 78 on the right.
  745. *
  746. * Assumes there is nothing to the right of the cursor on the current
  747. * line at start.  To handle that case, increase the number of SplitLines
  748. * in line 2 of the macro.
  749. *
  750. @f9     MacroBegin
  751.         "/*" SplitLine 8                  * start "C" comment
  752.         CursorDown CursorLeft             * go to upper left of box
  753.         UnmarkBlock MarkColumn            * start marking
  754.         GotoColumn "78" Return            * extend box
  755.         CursorDown 6
  756.         MarkColumn                        * close mark
  757.         FillBlock "*" Return              * and fill with *'s
  758.         CursorUp CursorLeft               * move in one on lower right
  759.         GotoBlockBeg PrevPosition         * remember old beginning
  760.         UnmarkBlock MarkColumn            * start marking new block
  761.         PrevPosition                      * back to beginning
  762.         CursorDown CursorRight            * move in one on upper left
  763.         MarkColumn                        * close mark
  764.         FillBlock " " Return              * and fill with spaces
  765.         UnmarkBlock
  766.         CursorDown 6 CursorLeft "*/"      * close "C" comment
  767.         CursorUp 5                        * and move to spot to start
  768.         CursorRight                       * typing inside the block
  769.  
  770. * --Tim Farley
  771.  
  772.  
  773. * ======================================================================
  774. * Date: 03-28-91 (12:29)           Number: 3716     SemWare Support BBS
  775. *   To: BOB DEHNHARDT              Refer#: 3715
  776. * From: RICHARD BLACKBURN            Read: YES
  777. * Subj: Macro Help!                  Conf: (21) ILink
  778. * ----------------------------------------------------------------------
  779. *
  780. *        ╒══>Quoting BOB from Date: 03-26-91 (10:36)
  781. *        │
  782. *        │1. Center the text I just typed in
  783. *        │2. Go to the beginning of  the line, turn insert
  784. *        │off, and type a slash "/"
  785. *        │3. Type astericks (asterixes? stars.) up to one
  786. *        │space before my centered
  787. *        │4. Jump to one space after the centered text, and
  788. *        │continue entering stars until column 78
  789. *        │5. Go to the beginning of the next line, with insert
  790. *        │turned back on
  791. *        ╘══════════════════════════════════════════════════
  792. *
  793. * 
  794. * ----------------------------------------------------------------------
  795. * @(f10) Center C Program Comment, Richard Blackburn, author
  796. * ----------------------------------------------------------------------
  797. * Here is a macro that will center a line and put "*'s" around your text.
  798. * It will not change your Insert status.
  799. *
  800. @f10    MacroBegin                   ** Start Macro
  801.             UnMarkBlock              *  make sure no blocks marked
  802.             BegLine                  *  goto start of line
  803.             DropAnchor               *  ---
  804.             DropAnchor               *  --- to save our place
  805.             CenterLine               *  center the line
  806.             GotoBlockBeg             *  goto begin of block
  807.             UnMarkBlock              *  un mark it
  808.             CursorLeft               *  cursor left twice
  809.             CursorLeft               *
  810.             JFalse end               *  if not goto end line to long
  811.             MarkColumn               *  mark column
  812.             BegLine                  *  goto beginning of line
  813.             DelCh                    *  delete char incase in insert mode
  814.             "/"                      *  put a / at start
  815.             MarkColumn               *  mark the column
  816.             FillBlock "*" Return     *  fill with *
  817.             Copy                     *  copy to scrap buffer
  818.             EndLine                  *  goto end of line
  819.             CursorRight              *  space over one
  820.             Paste                    *  paste the * in here also
  821.             UnMarkBlock              *  un mark the block
  822.     end:    BegLine                  *  goto start of line
  823.             AddLine                  *  and add a line
  824. *
  825. * 33 bytes Fri  03-29-1991  07:43:59 (added TH)
  826. *
  827. * This will do this
  828. *
  829. * /************************* This will do this *************************
  830.  
  831. * Leaving the cursor at the start of the next line.
  832.  
  833. * Richard Blackburn
  834. * SemWare Technical Support
  835. * Written Thu  03-28-1991  at 12:22:39
  836.  
  837.  
  838.